<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
	String path =request.getContextPath();
    String basePath =request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="basePath">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="<%=basePath%>/style/css/weui.css"/>
    <link rel="stylesheet" href="<%=basePath%>/style/css/example.css"/>
   
    <script type="text/javascript" src="<%=basePath%>/style/js/jquery-3.1.1.js" ></script>
    <style type="text/css">
    	#title
    	{
    		padding:20px;
    		font-size:40px;
    		font-weight:bold;
    		color:green;
    		text-align:center;
    	}
    </style>
<title>注册</title>
</head>
<body>
<div id="title">
	注册
</div>
<%-- <h2 style="color:red">${msg }</h2> --%>

<form action="<c:url value='/RegistServlet' />" method="post">
<div class="weui-cells weui-cells_form">
	
  <div class="weui-cell">
    <div class="weui-cell__hd"><label class="weui-label">用户名</label></div>
    <div class="weui-cell__bd">
      <input class="weui-input" type="text" name="username"  placeholder="请输入用户名">
      
    </div>
  </div>
  
  <div class="weui-cell">
    <div class="weui-cell__hd"><label class="weui-label">密码</label></div>
    <div class="weui-cell__bd">
      <input class="weui-input" type="password" name="password"  placeholder="请输入密码">
    
    </div>
  </div>
  
  
  	
  	
  	 <div id="toast" style="display: none;">
        <div class="weui-mask_transparent"></div>
        <div class="weui-toast">
            <i class="weui-icon-success-no-circle weui-icon_toast"></i>
            <p class="weui-toast__content">${msg }</p>
        </div>
    </div>
</div>
<br/>
<input type="submit" class="weui-btn weui-btn_primary" value="注册"/>
</form>
<a href="/chat/view/login.jsp" style="margin-top:10px;margin-right:10px;float:right;">已注册?去登陆吧</a>
	<script type="text/javascript">
	$(function(){
		
        var $toast = $('#toast');
	       if( ${msg !=null} )
	    	{
	            if ($toast.css('display') != 'none') return;

	            $toast.fadeIn(100);
	            setTimeout(function () {
	                $toast.fadeOut(100);
	            }, 2000);
	        }
    });
	</script>
	<script src="<%=basePath%>/style/js/zepto.min.js"></script>
    <script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
    <script src="<%=basePath%>/style/js/example.js"></script>
</body>
</html>